﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace RedfieldWeather.Controls
{
	public partial class Solar : System.Web.UI.UserControl
	{
		public void SetCurrentConditions(RFW.Weather.CurrentConditions cc)
		{
			lblUVIndex.Text = string.Format("{0:N2}", cc.Solar.UVIndex);
			lblRadiation.Text = string.Format("{0:N2}", cc.Solar.Radiation);

			if (cc.Solar.UVIndexRate > 0)
				lblUVChange.Text = "&uarr;";
			else if (cc.Solar.UVIndexRate == 0)
				lblUVChange.Text = "&nbsp;";
			else
				lblUVChange.Text = "&darr;";

			if (cc.Solar.RadiationRate > 0)
				lblRadiationChange.Text = "&uarr;";
			else if (cc.Solar.RadiationRate == 0)
				lblRadiationChange.Text = "&nbsp;";
			else
				lblRadiationChange.Text = "&darr;";
		}
	}
}